This present invention relates to software image processing. More specifically, it relates to a system and method for compressing and decompressing a binary code image.
Executable code or executable images are files, such as, files ending with extensions for example, but not limited to, xe2x80x9c.exexe2x80x9d and xe2x80x9c.bin.xe2x80x9d There is a growing need to maintain multiple executable images in different devices or systems in case of potential damage during normal use or image upgrades. To facilitate the need to maintain redundant or otherwise multiple executable images, either a device""s storage space is increased by a factor of two or more, or the image size is reduced. However, it is typically cost prohibitive to increase the storage space of a device. Thus, the reduction in image size, such as, by compressing the software image is a viable solution.
Compression techniques currently in use may only result in a file half the size of the original, typically resulting in undesirable transmission speeds. As a result, new technology such as interactive communication services, requiring larger data files to be stored or transmitted over a network, are possibly limited due to digital data storage size and transmission efficiency. Executable images represented by binary code and hereinafter referred to as xe2x80x9cbinary code imagesxe2x80x9d must be compressed to travel over the network or be stored in a memory element efficiently. Binary code images are data files consisting of a sequence of 8-bit data or executable code. Binary format is generally used to represent object code which are program instructions translated into a machine-readable form, or data in a transmission stream. Traditional methods typically compress data in a single contiguous stream. However, the nature of binary data, more specifically binary code images does not lend itself well to this methodology, since it includes operation codes mixed in with operands. Operation code is a portion of a machine or assembly language instruction that specifies the type of instruction and the structure of the data on which it operates. The operands are the objects of the computer instruction or mathematical operation. There are few matches between the operation codes and operands, making the compression of a binary code image difficult. As a result, compression ratios for binary code images are less than desirable, making transmission over a network or storage of the image inefficient.
Thus, there is a need to efficiently compress, and subsequently decompress or reconstruct binary code images to enable additional storage capability and to facilitate the transmission of the images over different networks.
The system and method for compressing and decompressing a binary code image is predicated on the recognition that binary code images are an intermingling of operation codes and operands. Many of the operation codes have similar patterns, while many of the operands have similar patterns. The system and method for compressing and decompressing a binary code image groups the binary code image data to take advantage of the similar patterns present amongst operation codes and similar patterns present amongst operands.
In accordance with one aspect of the present invention, a method for compressing and decompressing a binary code image includes the step of receiving an input of a binary code image and preprocessing the binary code image which includes parsing the image in a columnar format to match operating codes with operating codes and operands with operands. The method includes the step of compressing the preprocessed columnar data using one of a plurality of compression models and codes. The method then includes transferring the compressed image over a network or to a memory device. The method further includes receiving the compressed image and processing the compressed image prior to decompressing the compressed image to yield a reconstructed image.
In accordance with another aspect of the present invention, a system for compressing and decompressing a binary code image includes a first preprocessor to format the binary code image; a first processor to compress the formatted binary code image, a transmission channel or memory device used to channel or store the compressed image; and a second processor to reconstruct or decompress the image.
In a preferred embodiment, the compression and decompression are performed by the same processor, thus the first and second processors are the same processor. In another preferred embodiment, the first processor and second processor are separate and process the image in two different devices or systems.